<%@page import="java.sql.*,java.util.*"%>
<%

String userid=request.getParameter("userid");
String fname=request.getParameter("fname");

String lname=request.getParameter("lname");
String email=request.getParameter("email");
String pass=request.getParameter("pass");
String cpass=request.getParameter("cpass");
String dob=request.getParameter("dob");
int age=Integer.parseInt(request.getParameter("age"));
String gender=request.getParameter("gender");
String address=request.getParameter("address");
String country=request.getParameter("country");
String state=request.getParameter("state");
String city=request.getParameter("city");
int telephone=Integer.parseInt(request.getParameter("tno"));
int mobile=Integer.parseInt(request.getParameter("mobile"));
        try{
         Class.forName("com.mysql.jdbc.Driver");
           Connection con = DriverManager.getConnection("jdbc:mysql://localhost/premproject", " ", " ");
           Statement st=con.createStatement();
          String QueryString= "create table registrationone(userid int not null auto_increment,name " +
           "varchar(25),firstname varchar(20),lastname varchar(20),email varchar(20),pass varchar(20),confirm_pass varchar(20),dob date,age varchar(20),gender varchar(20),address varchar(20),country varchar(20),state varchar(20),city varchar(20),telephone varchar(20),mobile varchar(20),primary key(userid));";
           st.executeUpdate(QueryString);        
           int i=st.executeUpdate("insert into registrationone(userid,firstname,lastname,email,pass,confirm_pass,dob,age,gender,address,country,state,city,telephone,mobile) values('"+userid+"','"+fname+"','"+lname+"','"+email+"','"+pass+"','"+cpass+"','"+dob+"',"+age+",'"+gender+"','"+address+"','"+country+"','"+state+"','"+city+"',"+telephone+","+mobile+")");
        out.println("Data is successfully inserted!");
        }
        catch(Exception e){
        System.out.print(e);
        e.printStackTrace();
        }
        %>